package com.hdoit.kylin.web.money.modelconfig;

import com.hdoit.kylin.web.money.providers.AssetStateProvider;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;
/**
*@author liyaochong
*@email
*@createtime 2017年07月27日 15:15:58
*@comment
*/
public class AssetConfig extends ModelMetadataAttributeConfiguration{
	public AssetConfig(){
		this.setProperty("assetName")
				.hasAttribute(new DisplayNameAttribute("工具名"))
				.hasAttribute(new RequiredAttribute("工具名为必填项"));
		
		this.setProperty("buyDate")
				.hasAttribute(new DisplayNameAttribute("购买时间"))
				.hasAttribute(new DateTimeAttribute());

		this.setProperty("useDate")
				.hasAttribute(new DisplayNameAttribute("使用年限"));
		
		this.setProperty("buyerName")
				.hasAttribute(new DisplayNameAttribute("购买者姓名"));

		this.setProperty("state")
				.hasAttribute(new DisplayNameAttribute("状态"))
				.hasAttribute(new DropDownListAttribute(new AssetStateProvider()))
				.hasAttribute(new RequiredAttribute("状态为必填项"));
		
		this.setProperty("number")
				.hasAttribute(new DisplayNameAttribute("数量"))
				.hasAttribute(new RequiredAttribute("数量为必填项"));

		this.setProperty("price")
				.hasAttribute(new DisplayNameAttribute("单价"));
	}
}